import {
	createRouter,
	createWebHistory
} from 'vue-router';

// import LoginPage from '@views/LoginPage.vue'
import Layout from '@/Layout/index.vue'
import Dashboard from '@/views/Dashboard.vue';
const articleDetail = () => import('@/views/ArticleDetail.vue');
const Tag = () => import('@/views/Tag.vue');
const Category = () => import('@/views/Category.vue');
const Archive = () => import('@/views/Archive.vue');
const About = () => import('@/views/About.vue');


const routes = [
	{
	    path: '/',
	    redirect: '/login'
	 },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/LoginPage.vue')
  },
  
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: Dashboard // 使用直接导入的Dashboard组件
      },
      {
        path: 'article/:id',
        name: 'ArticleDetail',
        component: articleDetail
      },
      {
        path: 'tag',
        name: 'Tag',
        component: Tag
      },
      {
        path: 'category',
        name: 'Category',
        component: Category
      },
      {
        path: 'archive',
        name: 'Archive',
        component: Archive
      },
      {
        path: 'about',
        name: 'About',
        component: About
      }
    ]
  }
];

const router = createRouter({
	history: createWebHistory(),
	routes,
});

export default router;